﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using SqlSugar;

namespace WpfApp1
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public static SqlSugarScope DB;
        private string 路径 = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);

        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            DB = new SqlSugarScope(new ConnectionConfig()
            {
                DbType = DbType.Sqlite,
                IsAutoCloseConnection = true,
                InitKeyType = InitKeyType.Attribute,
                ConnectionString = $@"Data Source={路径}\代码库\代码库.db",
            });
        }
    }
}